package com.bawei.caohao0802.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.bawei.caohao0802.model.bean.KaiBean
import com.bawei.caohao0802.model.util.HttpUtils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import okhttp3.MultipartBody

/**
 * 作者: 曹浩
 * 时间: 2024/8/4
 * 功能描述:
 */
class ZhiBoViewModel :ViewModel(){
    var zhibodata= MutableLiveData<KaiBean>()
    fun getzhibo(
        userId: String,
        sessionId: String,
        liveType: Int,
        liveTitle: String,
        longitude: String,
        latitude: String,
        multipartBody: MultipartBody.Part
    ){
        HttpUtils.httpUtils.server.getzhibo(userId, sessionId, liveType, liveTitle, longitude, latitude, multipartBody)
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe {
                zhibodata.value=it
            }
    }
}